using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using Maxleaf.EDI.DataAccess.EDI.Mapping;
using Maxleaf.EDI.Domain.EDI;

namespace Maxleaf.EDI.DataAccess.EDI
{
    public partial class EDIContext : DbContext
    {
        static EDIContext()
        {
            Database.SetInitializer<EDIContext>(null);
        }

        public EDIContext(string connectionString)
            : base(connectionString)
        {
            this.Configuration.LazyLoadingEnabled = false;
        }

        public DbSet<DBDesc> DBDescs { get; set; }
        public DbSet<EX_Bill> EX_Bill { get; set; }
        public DbSet<User_DB> User_DB { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Configurations.Add(new DBDescMap());
            modelBuilder.Configurations.Add(new EX_BillMap());
            modelBuilder.Configurations.Add(new User_DBMap());
        }
    }
}
